/*
* 评论
* */
const mongoose = require('mongoose');
const commentSchema = new mongoose.Schema({
  //文章id
  aid: {
    type: mongoose.Schema.Types.ObjectId,
    ref: 'Article'
  },
  //用户id
  uid: {
    type: mongoose.Schema.Types.ObjectId,
    ref: 'User'
  },
  //评论日期
  time: {
    type: Date,
    default: Date.now
  },
  //评论内容
  content: {
    type: String,
    default: null
  },
  state: {
    type: Number,
    default: 1
  }
});

//创建评论集合
const Comment = mongoose.model('Comment',commentSchema);
module.exports = {
  Comment
}